package com.chj.controllers;

import com.chj.beans.vo.MessageVo;
import com.chj.producers.RabbitMQProducer;
import com.chj.utils.PulsarUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.UUID;

@RestController
@RequestMapping("/pulsar")
public class PulsarController {

    @GetMapping("send")
    public ResponseEntity<?> sendMessage(){

        String message = "This is a kafka message, messageID: " + UUID.randomUUID().toString();
        PulsarUtil.getInstance().sendMQMsg(message);
        return ResponseEntity.ok().build();
    }
}
